package com.ruoyi.web.controller.zsix;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.zsix.service.IDictDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/dicts")
public class DictDataController extends BaseController {
    @Autowired
    private IDictDataService iDictDataService;

    @Log(title = "获取表单字典列表" , businessType = BusinessType.EXPORT)
    @PostMapping("/dictDataList")
    public AjaxResult dictDataList(){
        return success(iDictDataService.getDicts());
    }

    /**
     * 获取表单字典数据
     * @param dictTypeNo
     * @return
     */
    @Log(title = "获取表单字典数据" , businessType = BusinessType.EXPORT)
    @GetMapping("/getDictDatas")
    public AjaxResult getDictDatas(@RequestParam("dictTypeNo") String dictTypeNo){
        return success(iDictDataService.getDictAndData(dictTypeNo));
    }
}
